package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.common.result.Result;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ybl
 * @version 1.9
 * @date 2021/5/19 8:36
 * 科室操作
 */
@Api(tags = "科室操作")
@RestController
@RequestMapping("admin/hosp/department")
public class DepartmentController {

  @Autowired
  private DepartmentService departmentService;

  //根据医院编号查询科室信息
  @ApiOperation(value = "根据医院编号查询科室列表")
  @GetMapping("getDeptList/{hoscode}")
  public Result findDeptByHosCode(String hoscode){
    List<DepartmentVo> list = departmentService.getDeptTree(hoscode);
    return Result.ok(list);
  }

}
